package dev.alm.guiguxiaozhiapp.tools;

import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Component;

@Component
public class CalculatorTools {

    @Tool(name = "加法运算", value = "将a和b相加并返回运算结果")
    public double sum(double a, double b) {
        System.out.println("sum");
        return a + b;
    }

    @Tool(name = "平方根运算", value = "计算a的平方根并返回运算结果")
    public double squareRoot(double a) {
        System.out.println("square root");
        return Math.sqrt(a);
    }

}
